{% load markup %}
{% load comments %}

    <div class="oneliner well oneliner-{{oneliner.pk}}">
	<h3 class="summary">
	    <a href="{% url oneliners.views.oneliner oneliner.pk %}">{{ oneliner.summary|capfirst }}</a>
	    {% if user == oneliner.user %}
	    <a class="btn" href="{% url oneliners.views.oneliner_edit oneliner.pk %}"><i class="icon-pencil"></i>{% if not oneliner.is_published %}<span class="draft">(Not published!)</span>{% endif %}</a>
	    {% endif %}
	</h3>

	<pre><span class="add-on">bash$ </span>{{ oneliner.line }}</pre>

	<p class="author"><small>
	&mdash; by <a href="{% url oneliners.views.profile oneliner.user.pk %}"><span>{{ oneliner.user.hackerprofile.get_display_name }}</span></a>
	    on <span>{{ oneliner.created_dt }}</span>
	</small></p>

	<div class="explanation">
	    <h4>Explanation</h4>
	    {{ oneliner.explanation|markdown:"safe" }}
	</div>

	{% if oneliner.limitations %}
	<div class="limitations">
	    <h4>Limitations</h4>
	    {{ oneliner.limitations|markdown:"safe" }}
	</div>
	{% endif %}

	{% if user == question.user and not question.is_answered %}
	<p><a href="{% url oneliners.ajax.question_answered question.pk oneliner.pk %}" class="btn btn-primary question-answered" data-parent="question-{{ question.pk }}">Accept this answer</a></p>
	{% endif %}

	{% if user.is_authenticated and not nobuttons %}
	<p>
	    <a href="{% url oneliners.views.oneliner_alternative oneliner.pk %}" class="btn">Post an alternative one-liner</a>
	    <a href="{% url oneliners.views.oneliner_comment oneliner.pk %}" class="btn"><i class="icon-comment"></i> Post a comment on this one-liner</a>
	</p>
	{% endif %}

	{% block related %}
	{% endblock %}

	{% get_comment_count for oneliner as comment_count %}
	{% if comment_count > 0 %}
	<div class="related">
	    <h3 class="comments-toggle {{ comments_expanded }}"><img/>Comments ({{ comment_count }})</h3>
	    <div class="well comments {{ comments_expanded }}">
	    {% render_comment_list for oneliner %}
	    {% if user.is_authenticated and not nobuttons %}
	    <p><a href="{% url oneliners.views.oneliner_comment oneliner.pk %}" class="btn"><i class="icon-comment"></i> Post a comment on this one-liner</a></p>
	    {% endif %}
	    </div>
	</div>
	{% endif %}

    </div>
